<template>
  <!-- <header class="m-header" :class="{'is-bg-red':bgRed, 'is-fixed':fixed}">
    <div class="leftItem">
      <slot name="left"></slot>
    </div>
    <div class="m-header-title" v-text="title">123</div>
    <div class="rightItem">
      <slot name="right"></slot>
    </div>
  </header> -->
    <header class="m-header" :class="{'is-bg-red':bgRed, 'is-fixed':fixed}">
    <div class="leftItem">
      <slot name="left"></slot>
    </div>
    <div class="m-header-title">
        <button>全部标签</button>
    </div>
    <div class="rightItem">
      <slot name="right"></slot>
    </div>
  </header>
</template>

<script>
export default {
  name: "NavBar",
  props: {
    title: {
      type: String,
      default: ""
    },
    bgRed: {
      type: Boolean,
      default: false
    },
    fixed: {
      type: Boolean,
      default: true
    }
  }
};
</script>

<style lang="less" scoped>
// .m-header {
// 	width: 100%;
// 	height: 1rem;
// 	background-color: red;
// 	display: flex;
// 	.leftItem, .rightItem {
// 		flex: 1;
// 		background-color: blue;
// 	}
// 	.m-header-title {
// 		flex: 3;
// 	}
// }
.m-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  height: 96px;
  background-color: rgb(10, 1, 35);
  border-bottom: 1px solid #e5e5e5;

  .leftItem {
    margin-top: 24px;
    width: 60px;
    height: 40px;

    a {
      display: block;
      text-decoration: none;
      color: #333;
      font-size: 16px;

      img {
        padding: 10px 10px;
        width: 24px;
        height: 24px;
      }
    }
  }

  .m-header-title {
    width: 100%;
    height: 44px;
    margin-top: 24px;
    line-height: 44px;
    display: flex;
    justify-content: center;
    font-size: 18px;
    color: #333;
    button {
        border: none;
        width: 10rem;
        height: 2.4rem;
        background-color: rgb(242,242,242);
    }
  }

  .rightItem {
    margin-top: 24px;
    width: 60px;
    height: 40px;

    a {
      display: block;
      text-decoration: none;
      color: #333;
      font-size: 16px;

      img {
        padding: 9px 8px;
        width: 24px;
        height: 24px;
      }
    }
  }

  &.is-fixed {
    position: fixed;
    left: 0px;
    right: 0px;
    top: 0px;
    z-index: 9;
  }

  &.is-bg-red {
    background-color: #ee424a;

    .m-header-title,
    .m-header-left,
    .m-header-right {
      color: white;
    }
  }
}
</style>
